<template>
	<view class="content autnstatus-cnt">
		<image class="autnstatus-icon" :src="type == 1 ? '/static/images/autn_status.png' : '/static/images/autn_status2.png'"></image>
		<view v-if="type == 1" class="auth-msg f-32">恭喜您认证成功！</view>
		<view v-else class="auth-msg f-32 fail">认证失败</view>
		
		
		<view v-if="type == 1"  class="auto-tip f-24">接下来您可以使用微信绑定手机号登录电脑端可信工作证签发平台完成后续的证件制作以及签发等操作</view>
		<view v-else class="auto-tip f-24">{{msg}}</view>
		<view v-if="type != 1" class="btn-box">
			<!-- <view @click="gohome" class="btn">返回首页</view> -->
			<view @click="getTo('/pages/companyAuth/index')" class="btn big-btn">重新认证</view>
		</view>
		<view v-else class="btn-box">
			<view @click="gohome" class="btn big-btn">返回首页</view>
		</view>
	</view>

</template>

<script>
	export default {
		data() {
			return {
				msg: '',
				type: '1' // 1成功   2 失败
			}
		},
		onLoad: function(e) {
			this.type = e.type
			this.msg = e.msg || '请核对好您的个人信息，有误信息会影响认证是否成功'
			let ctid = e.ctid || ''
			if (ctid) {
				uni.setStorageSync('ctid', ctid);
			}
			if (this.type == 1) {
				this.pushData()
			}
			
		},
		methods: {
			goback() {
				uni.navigateBack({
				    delta: 2
				});
			},
			
			getTo(url) {
				uni.navigateTo({
				    url: url
				});
			},
			getCard() {
				uni.navigateTo({
				    url: '/pages/applyCertificate/index'
				});
			},
			gohome() {
				uni.switchTab({
					url: '/pages/index/index'
				});
			},
			pushData() {
				this.$HTTP.post('/user/update_role', {}, false).then((res3) => {
					
				}).catch((err) => {
					
				})
			}
		}


	}
</script>

<style lang="scss" scoped>
	.autnstatus-cnt {
		text-align: center;
		.autnstatus-icon {
			width: 324rpx;
			height: 329rpx;
			margin: 91rpx auto 40rpx auto;
		}
		.auth-msg {
			color: #333333;
			font-weight: bold;
		}
		.auth-msg.fail {
			color: #FF6868;
		}
		.auto-tip {
			margin-top: 32rpx;
			margin: 32rpx 86rpx 0 86rpx;
			color: #666666;
		}
	}
	.btn-box {
		margin-top: 194rpx;
		.btn {
			display: inline-block;
			width: 240rpx;
			height: 65rpx;
			margin: 20rpx 42rpx;
			background: #0579FE;
			border: 1rpx solid #0579FE;
			border-radius: 33rpx;
			color: #FFFFFF;
			line-height: 65rpx;
		}
		.second-style {
			background: #FFFFFF;
			color: #0579FE;
		}
		.big-btn {
			width: 454rpx;
			height: 93rpx;
			background: #0579FE;
			box-shadow: 0px 6rpx 16rpx 0px rgba(5, 121, 254, 0.4);
			border-radius: 47rpx;
			line-height: 93rpx;
		}
	}
</style>
